< previous page page_397 next page >

Page 397
0397-01.gif
Figure 12.18
Reflecting an object across an arbitrary line.
e10a6a0a59f035e870d90cca05b85fce.gif
             Else
                 M(i, j) = 0
             End If
         Next j
     Next i
End Sub

' Create a translation matrix for translation by
' distances tx and ty.
Public Sub m2Translate(Result() As Single, _
    ByVal tx As Single, ByVal ty As Single)

    m2Identity Result
    Result(3, 1) = tx
    Result(3, 2) = ty
End Sub

' Create a scaling matrix for scaling by factors
' of sx and sy.
Public Sub m2Scale(Result() As Single, _
    ByVal sx As Single, ByVal sy As Single)

    m2Identity Result

 
< previous page page_397 next page >